/**
 * Convert a date string to 'yyyy-MM-dd HH:mm:ss' format.
 * @param {string} dateStr - The date string to convert.
 * @returns {string} - The formatted date string.
 */
function formatDateTime(dateStr) {
    const date = new Date(dateStr);
    const yyyy = date.getFullYear();
    const MM = String(date.getMonth() + 1).padStart(2, '0');
    const dd = String(date.getDate()).padStart(2, '0');
    const HH = String(date.getHours()).padStart(2, '0');
    const mm = String(date.getMinutes()).padStart(2, '0');
    const ss = String(date.getSeconds()).padStart(2, '0');
    return `${yyyy}-${MM}-${dd} ${HH}:${mm}:${ss}`;
}

export { formatDateTime };
